// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  {
    path: '/',
    name: 'Home',
    component: import('@/views/Home/home-index.vue'),
  },
  {
    path: '/Login',
    name: 'Login',
    component: import('@/views/Login/login-index.vue'),
  },
  {
    path: '/Detail',
    name: 'Detail',
    component: import('@/views/Detail/detail-index.vue'),
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

//  全局前置守卫
router.beforeEach((to, from, next) => {
  console.log('全局前置守卫');
  next();
});

export default router;